package com.IO.FileInputStream;

import java.io.File;
import java.io.FileInputStream;

/**
 * name：zhangwang
 * time：2025/3/11 16:48
 */
public class Test3 {
    public static void main(String[] args) throws Exception {
        File file = new File("1_张旺-Java基础.txt");
        FileInputStream fileInputStream = new FileInputStream(file);
        //一次性读取文件的全部字节
        byte[] bt =new  byte[(int) file.length()];
        fileInputStream.read(bt);
        System.out.println(new String(bt,0, bt.length));
        fileInputStream.close();
    }
}
